# from moviepy.editor import VideoFileClip
# from PIL import Image
#
#
# def extract_video_cover(video_path, output_path):
#     # 加载视频剪辑
#     video_clip = VideoFileClip(video_path)
#
#     # 获取视频的第一帧作为封面
#     video_cover = video_clip.get_frame(0)
#
#     # 保存封面图像
#     video_cover_image = Image.fromarray(video_cover)
#     video_cover_image.save(output_path)
#
#     # 关闭视频剪辑
#     video_clip.close()
#
#
# # 用法示例
# video_path = r'F:\video\mixkit\20231207\cities_20231207_094409.925480.mp4'  # 替换为你的视频文件路径
# output_path = './cover.jpg'  # 替换为你想保存封面的文件路径
#
# extract_video_cover(video_path, output_path)

# # 截取浮点数的小数点后两位
# consume_second = 48.62772822380066
# truncated_consume_second = int(consume_second * 100) / 100
# print("截断后的结果：", truncated_consume_second)

